<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	compCd		= Request("compCd")
	prdCd		= Request("prdCd")
	qty			= Request("qty")
	sourceLotNo = Request("sourceLotNo")
	sourceSize	= Request("sourceSize")
	deliveryDt	= Request("deliveryDt")
	amount		= Request("amount")
	compMemo	= Request("compMemo")
	workMemo	= Request("workMemo")
	remarks		= Request("remarks")
	fullLotNo	= Request("fullLotNo")
	lotSubNo		= Request("lotSubNo")
	procTypeCd	= Request("procTypeCd")
	planDt		= Request("planDt")
	orgSrcCd		= Request("orgSrcCd")
	orgSrcCnt		= Request("orgSrcCnt")
	compOrderArticleSeq		= Request("compOrderArticleSeq")
	types		= Request("type")
	flag		= Request("flag")

	sourceLotNo	= Replace(sourceLotNo,"'","''")
	prdNm		= Replace(prdNm,"'","''")
	sourceSize	= Replace(sourceSize,"'","''")
	compMemo	= Replace(compMemo,"'","''")
	workMemo	= Replace(workMemo,"'","''")
	remarks		= Replace(remarks,"'","''")
	amount		= Replace(amount, ",","")
	
	If orgSrcCnt = "" Then orgSrcCnt = 0 End If 
	If amount = "" Then 
		amount = 0
	End If 
	If lotSubNo = "" Then 
		lotSubNo = "0"
	End If 

	If fullLotNo <> "" Then 
		'divLotNo = Split(fullLotNo,"-")
		lotYear = Left(fullLotNo,2)
		lotNo = Right(fullLotNo,4)
	End If 
	issueId = Request.Cookies("S_uid")

	SQLTitle = "-- ■■■■ 작업 지시 저장 ■■■■"
	SQL = "exec spOrder '" & lotNo & "', '" & lotYear & "', '" & lotSubNo & "', '" & compCd & "', '" & prdCd & "', " & qty & ", " & amount & ", '" & sourceLotNo & "', '" & sourceSize & "', '" & planDt & "', '" & deliveryDt & "', '" & flag & "', '" & issueId & "', " & procTypeCd & ", '" & types & "', '" & orgSrcCd & "', " & orgSrcCnt & "," & compOrderArticleSeq & ", '" & compMemo & "', '" & workMemo & "', '" & remarks & "'" 

'Response.write sql

	If xMode="debug" Then 
		Call showDebug(SQLTitle,SQL) 
	End If 

'Response.write SQL
'Response.end
	DbCon.Execute SQL

	Call rsWithXML("Save OK!")
%>